/* 审批相关路由 */

import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';
import homeSub from './homeSub';

const Approval: AppRouteRecordRaw = {
  path: '/workplace2',
  name: 'WorkPlace2',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: '工作台',
    requiresAuth: true,
    icon: 'icon-home',
    roles: ['admin'],
    hideInMenu: false
  },
  redirect: {
    name: 'WorkPlace'
  },
  children: [
    ...homeSub,
    {
      path: '/myApproval',
      name: 'MyApproval',
      component: () => import('@/views/Management/Home/MyApproval/index.vue'),
      meta: {
        locale: '我的审批',
        requiresAuth: true,
        icon: 'icon-jichushezhi',
        roles: ['*'],
        hideInMenu: false
      }
    },
    {
      path: '/myApproval/approvalDetails',
      name: 'ApprovalDetails',
      component: () =>
        import('@/views/Management/Home/MyApproval/ApprovalDetails/index.vue'),
      meta: {
        locale: '审批详情',
        requiresAuth: true,
        icon: 'icon-jichushezhi',
        roles: ['*'],
        hideInMenu: true
      }
    },
    {
      path: '/center',
      name: 'Center',
      component: () => import('@/qiankun/index.vue'),
      meta: {
        locale: '申请中心',
        requiresAuth: true,
        icon: 'icon-jichushezhi',
        roles: ['*'],
        hideInMenu: false
      }
    }
  ]
};

export default Approval;
